Method and apparatus for ray tracing in a 3-dimensional image system

ABSTRACT

A ray tracing method and apparatus in a 3-Dimensional (3D) image system. The method includes sampling for four vertexes of each pixel in a plurality of pixels, sampling for a pivot of the each pixel, and determining a color of the each pixel using the sampling result on the four vertexes and the pivot.

CROSS-REFERENCE TO RELATED APPLICATION(S) AND CLAIM OF PRIORITY

The present application is related to and claims priority under 35U.S.C. §119(a) to a Korean Patent Application filed in the KoreanIntellectual Property Office on Jun. 14, 2010 and assigned Serial No.10-2010-0055825, the contents of which are herein incorporated byreference.

TECHNICAL FIELD OF THE INVENTION

The present invention relates to a 3-Dimensional (3D) image system. Moreparticularly, the present invention relates to a ray tracing method andapparatus for Anti-Aliasing (AA).

BACKGROUND OF THE INVENTION

A 3D image system performs a rendering process of making a 3D image byinstilling a realistic sensation into a 2-Dimensional (2D) image byconsidering external information such as light sources, positions,colors and the like. One example of the rendering is a ray tracingtechnique.

A ray tracing technique is a technique that includes, after generating aray corresponding to each pixel of a screen from the observer viewpoint,determining a color of the each pixel depending on a primitive crossingwith these rays to make a 3D image. That is, the ray tracing techniqueperforms one or more samplings of each pixel and determines a color of acorresponding pixel.

In the above ray tracing technique, when generating one ray for onepixel, if a boundary of a primitive ranges over within one pixel, analiasing phenomenon takes place, thus causing a problem of making aimage non-realistic. Accordingly, the conventional ray tracing techniqueprovides an AA technique of generating a plurality of rays for one pixeland determining a color of the pixel depending on an area that aprimitive occupies in the pixel, thereby decreasing the occurrence ofthe aliasing phenomenon.

FIGS. 1A to 1C illustrate an aliasing phenomenon and an AA technique inthe conventional ray tracing technique. In FIG. 1A, it is assumed that atriangular primitive exists in a virtual 3D space, and one ray isgenerated for the pivot (indicated by a dot) in each pixel. A color of apixel whose one ray crosses within the triangle is determined as a colorof the triangle, and a color of a pixel whose one ray does not crosswithin the triangle is determined as a background color. So, asillustrated in FIG. 1B, an image is made of a form that is difficult fora user to recognize as the triangle.

Accordingly, the conventional art provides a technique of making animage of a form that a user may recognize as a triangle as illustratedin FIG. 1C, by determining a color of each pixel considering an areathat a primitive occupies in each pixel in FIG. 1A. In detail, theconventional art provides a scheme of generating a plurality of rays foreach pixel, checking if a primitive crosses with a plurality of rays,and giving a weight to a color of the cross primitive, therebydetermining a color of each pixel. For example, the conventional artprovides a super sampling scheme of sampling at constant intervalswithin each pixel, a statistic sampling scheme of dividing each pixelinto a plural number and generating a ray in an arbitrary position ofeach of the divided pixels, and the like.

But, the above scheme of generating a plurality of rays for one pixelhas a problem of needing many operation amounts compared to a scheme ofgenerating one ray for one pixel.

As described above, the ray tracing technique has an advantage of makingan image more realistic as the number of simulating rays is large, whilehaving a disadvantage of needing many operation amounts. In contrast,the ray tracing technique has an advantage of decreasing an operationamount as the number of simulating rays is reduced, while having adisadvantage of inducing aliasing and degrading a quality of an image.

So, there is a need to provide a technique of, when rendering a 3Dimage, restricting the number of rays for each pixel while minimizingthe occurrence of the aliasing.

SUMMARY OF THE INVENTION

An aspect of the present invention is to substantially solve at leastthe above problems and/or disadvantages and to provide at least theadvantages below. Accordingly, one aspect of the present invention is toprovide a ray tracing method and apparatus in a 3-Dimensional (3D) imagesystem.

Another aspect of the present invention is to provide a ray tracingmethod and apparatus for minimizing the occurrence of an aliasingphenomenon while simultaneously minimizing an operation amount in a 3Dimage system.

A further aspect of the present invention is to provide a method andapparatus for generating and tracing rays for four vertexes and a pivotof each pixel in a 3D image system.

The above aspects are achieved by providing a ray tracing method andapparatus in a 3D image system.

According to one aspect of the present invention, a ray tracing methodin a 3D image system is provided. The method includes sampling for fourvertexes of each pixel in a plurality of pixels, sampling for the pivotof the each pixel, and determining a color of the each pixel using thesampling result on the four vertexes and the pivot.

According to another aspect of the present invention, a ray tracingapparatus in a 3D image system is provided. The apparatus includes asampling unit and a color determination unit. The sampling unit isconfigured to sample for four vertexes and a pivot of each pixel in aplurality of pixels. The color determination unit is configured todetermine a color of the each pixel using the sampling result for thefour vertexes and the pivot.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features and advantages of the presentinvention will become more apparent from the following detaileddescription when taken in conjunction with the accompanying drawings inwhich:

FIGS. 1A to 1C illustrate an aliasing phenomenon and an Anti-Aliasing(AA) technique in the conventional ray tracing technique;

FIG. 2 illustrates a ray generation position in a 3-Dimensional (3D)image system according to an embodiment of the present invention;

FIG. 3 illustrates a construction for tracing a ray in a 3D image systemaccording to an embodiment of the present invention;

FIG. 4 illustrates a procedure of tracing a ray in a 3D image systemaccording to an embodiment of the present invention; and

FIG. 5 illustrates pixels without a cross check for their pivots in a 3Dimage system according to an embodiment of the present invention.

Throughout the drawings, like reference numerals will be understood torefer to like parts, components and structures.

DETAILED DESCRIPTION OF THE INVENTION

FIGS. 1 to 5, discussed below, and the various embodiments used todescribe the principles of the present disclosure in this patentdocument are by way of illustration only and should not be construed inany way to limit the scope of the disclosure. Those skilled in the artwill understand that the principles of the present disclosure may beimplemented in any suitably arranged electronic device. Preferredembodiments of the present invention will be described herein below withreference to the accompanying drawings. In the following description,well-known functions or constructions are not described in detail sincethey would obscure the invention in unnecessary detail. And, termsdescribed below, which are defined considering functions in the presentinvention, can be different depending on user and operator's intentionor practice. Therefore, the terms should be defined on the basis of thedisclosure throughout this specification.

Exemplary embodiments of the present invention provide a ray tracingmethod and apparatus in, a 3-Dimensional (3D) image system. Below, forthe sake of convenience, a description is made for generating only aprimary ray for each pixel, for example, but it will be understood thatother embodiments may include generating an additional ray according toattribute information of a primitive that the primary ray crosses with,and deteimining a color of a corresponding pixel in consideration of theadditional ray.

FIG. 2 illustrates a ray generation position in a 3D image systemaccording to an embodiment of the present invention.

As illustrated in FIG. 2, the 3D image system of the present inventionperforms sampling for four vertexes and the pivot of each pixel. Thatis, the 3D image system generates rays for the four vertexes and a rayfor the pivot of each pixel and checks if each of the rays crosses witha primitive. Here, although the 3D image system performs the samplingfor the four vertexes of each pixel, compared to the conventional raytracing, techniques, the four vertexes use a reduced operation amountbecause the four vertexes overlap with vertexes of neighboring pixels.For instance, assuming that a screen has a resolution of ‘x×y’, whengenerating four rays in arbitrary positions of one pixel, theconventional statistic sampling technique should perform sampling of‘x×y×4’ times, but the 3D image system of the present invention performsonly sampling of ‘(x×y)+x+y+1’ times. When considering a sampling forfour vertexes of each pixel and additionally sampling for the pivot ofeach pixel, it may be appreciated that the number of times of samplingof the present invention is equal to ‘2(x×y)+x+y+1’, and its operationamount is reduced compared to ‘x×y×5’, which is the number of times ofsampling required when performing sampling at a rate of 5 times for eachpixel according to the conventional technique.

Also, the 3D image system of the present invention performs a searchbased on an acceleration data structure only at the time of sampling forfour vertexes of each pixel to determine a color of the each pixel and,for the pivot of the each pixel, does not perform the search based onthe acceleration data structure. That is, for the pivot of the eachpixel, the 3D image system performs a cross check with primitivesobtained from the sampling result of the four vertexes. As above,compared to the conventional technique of performing a search based onan acceleration data structure for all sampling positions, the 3D imagesystem performs, only for the four vertexes, the search based on theacceleration data structure, thereby being capable of reducing anoperation amount.

As above, the 3D image system performs sampling for four vertexes andthe pivot of each pixel and, according to Equation 1 below, gives aweight to a color of a primitive searched according to the samplingresult and determines a color of a corresponding pixel. It will beunderstood that the scheme of determining the color of the each pixelmay be modified within the scope of the present invention.

$\begin{matrix}{C = {\sum\limits_{i = 0}^{n}\left( {c_{i} \times w_{i}} \right)}} & \left\lbrack {{Eqn}.\mspace{14mu} 1} \right\rbrack\end{matrix}$

In Equation 1 above, the “C” represents a color of a correspondingpixel, the ‘c_(i)’ represents a color of a primitive searched as thesampling result to cross with an ith ray among five rays of thecorresponding pixel, and the ‘w_(i)’ represents a weight for the colorof the primitive crossing with the ith ray. Here, the sum of the ‘w_(i)’is equal to ‘1’.

A ray tracing technique of performing sampling for four vertexes and thepivot of each pixel as above is described in detail with reference toFIGS. 3 and 4 below.

FIG. 3 illustrates an apparatus for tracing a ray in a 3D image systemaccording to an embodiment of the present invention.

Referring to FIG. 3, the 3D image system includes a sampling unit 300, acolor determination unit 310, a storne unit 320, and a 3D imagegeneration unit 330.

The sampling unit 300 generates rays for four vertexes and the pivot ofeach pixel of a screen from the observer viewpoint, traces the rays forthe four vertexes and the pivot, and checks if the rays cross with aprimitive existing in a 3D virtual space. When the rays cross with theprimitive, the sampling unit 300 acquires color information of theprimitive corresponding to a cross position. After that, the samplingunit 300 provides the color determination unit 310 with crossinformation of the rays and the primitive and the color information ofthe primitive corresponding to the cross position. The sampling unit 300may acquire the color information of the primitive corresponding to thecross position itself and provide the acquired color information to thecolor determination unit 310. Alternatively, the sampling unit 300 mayacquire a reference value of the storage unit 320 that stores the colorinformation of the primitive corresponding to the cross position andprovide the acquired reference value to the color determination unit310. Also, when the rays do not cross with the primitive, the samplingunit 300 provides information that indicates no crossing to the colordetermination unit 310.

Particularly, the sampling unit 300 includes a vertex sampling unit 302and a pivot sampling unit 304. Through the vertex sampling unit 302 andthe pivot sampling unit 304, the sampling unit 300 performs sampling forfour vertexes of each pixel and sampling for the pivot of the eachpixel. That is, after generating rays for four vertexes of each pixelfrom the observer viewpoint, the vertex sampling unit 302 traces therays of the four vertexes through an acceleration data structure andchecks if the rays cross with a primitive. Here, the acceleration datastructure is a scheme of dividing a virtual 3D space into a plurality ofsub spaces and, for a primitive included in a sub space where a raycrosses among the divided sub spaces, performing a cross check for theray and the primitive. Its example is an acceleration data structuretechnique of a tree form. The present invention may use variousacceleration data structure techniques well known to the conventionalart. The vertex sampling unit 302 performs a cross check for the fourvertexes with the primitive using the acceleration data structuretechnique. When the check result is that there is a primitive crossingwith at least one of the rays of the four vertexes, the vertex samplingunit 302 acquires color information of the primitive corresponding to across position and provides the acquired color information to the colordetermination unit 310. Also, when the check result indicates that thereis a primitive crossing with at least one of the rays of the fourvertexes, the vertex sampling unit 302 provides information of the crossprimitives to the pivot sampling unit 304.

Also, the pivot sampling unit 304 generates a ray for the pivot of eachpixel from the observer viewpoint and then, checks if the generated rayof the pivot crosses with a primitive. The pivot sampling unit 304 maytrace the ray of the pivot through an acceleration data structure toperform a cross check for the ray of the pivot and the primitive, butmay check if the ray of the pivot crosses with cross primitives providedfrom the vertex sampling unit 302. This is because, when considering asize of a pixel based on a resolution of a screen, a size of one pixelis small, so it is not likely that a ray of the pivot of a predeterminedpixel crosses with any primitive not crossing with rays of four vertexesof the predetermined pixel. That is, assuming that, if a ray of thepivot of a predetermined pixel crosses with a primitive, the crossprimitive is a primitive crossing with at least one of the rays of thefour vertexes of the predeteimined pixel. Then, the present inventionchecks if the ray of the pivot crosses with the primitives crossing withat least one of the rays of the four vertexes. By not performing anacceleration data structure for a ray of the pivot of each pixel asabove, the present invention may obtain an effect of being capable ofreducing an operation amount compared to the conventional techniques ofperforming sampling of the same number of times for each pixel. Here,the pivot sampling unit 304 may check if the ray of the pivot crosseswith the cross primitives using a linear equation for the ray of thepivot and a planar equation for the primitives crossing with at leastone of the rays of the four vertexes. Also, when there is a primitivecrossing with the ray of the pivot, the pivot sampling unit 304 acquirescolor information of the primitive corresponding to a cross position andprovides the acquired color information to the color determination unit310.

Also, when there is not a primitive crossing with at least one of therays of the four vertexes, the pivot sampling unit 304 may omit a crosscheck for the ray of the pivot and determine that there is not aprimitive crossing with the ray of the pivot. In contrast, when all therays of the four vertexes cross with one primitive, the pivot samplingunit 304 may omit a cross check for the ray of the pivot and determinethat the one primitive crosses with the ray of the pivot. For example,when there is not a primitive crossing with at least one of rays of fourvertexes of a pixel or all the rays of the four vertexes cross with oneprimitive as illustrated in FIG. 5, the pivot sampling unit 340 may omita cross check for the pivot of a corresponding pixel, and perform across check only for the pivots of other pixels. In FIG. 5, ‘X’ denotesa pixel performing a cross check for its pivot.

The color determination unit 310 receives the sampling result on fourvertexes and the pivot of each pixel from the sampling unit 300, anddetermines a color of each pixel using the sampling result. In detail,the color determination unit 310 determines if rays of the four vertexesand the pivot of the each pixel each cross with a primitive and, when itis determined to cross, if color information of the primitivecorresponding to a cross position is provided, according to Equationabove, the color determination unit 310 gives a weight to the colorinformation of the primitive corresponding to the cross position anddetermines a color of each pixel.

For instance, assuming that ‘R1’, ‘R2’, ‘R3’, ‘R4’, and ‘R5’ each denoterays of one of the four vertexes and the pivot of a predetermined pixel,and that ‘R1’ crosses with a primitive ‘P1’, ‘R2’ and ‘R3’ cross with noprimitive, and ‘R4’ and ‘R5’ cross with a primitive ‘P2’, the colordetermination unit 310 may multiply C_(P1) (a color of primitive ‘P1’)by a weight ‘⅕’ since ‘P1’ crosses with one ray, multiply C_(P2) (acolor of primitive ‘P2’) by a weight ‘⅖’ since ‘P2’ crosses with tworays, and then add these products and determine the addition result as acolor value of the predetermined pixel.

Also, when there is no primitive crossing with rays of four vertexes ofa predetermined pixel, the color determination unit 310 determines acolor of the predetermined pixel as a preset background color.

The storage unit 320 stores various programs and data for a generaloperation of the 3D image system, and stores information (e.g.,primitive form, position, color information and the like) on primitivesmodeled in a 3D virtual space.

The 3D image generation unit 330 receives color information of eachpixel from the color determination unit 310 and, according to the colorinformation, colors each pixel of a screen to make a 3D image.

FIG. 4 is a flowchart illustrating a procedure of tracing a ray in a 3Dimage system according to an embodiment of the present invention.

Referring to FIG. 4, in step 401, the system generates rays for fourvertexes by each pixel of a screen from the observer viewpoint and then,proceeds to step 403 and searches a primitive crossing with the rays ofthe four vertexes. Here, the system traces the rays of the four vertexesthrough an acceleration data structure and checks if the rays cross withthe primitive existing in a virtual 3D space. Here, the accelerationdata structure is a scheme of dividing the virtual 3D space into aplurality of sub spaces and, for a primitive included in a sub spacewhere a ray crosses among the divided sub spaces, performing a crosscheck for the ray and the primitive. The present invention may usevarious acceleration data structure techniques well known to theconventional art.

After that, in step 405, the system checks if there is at least oneprimitive crossing with at least one of the rays of the four vertexes.When there is not a primitive crossing with at least one of the rays ofthe four vertexes, i.e., when there is not a cross primitive for each ofthe rays of the four vertexes as a result of a cross check for each ofthe rays of the four vertexes, the system proceeds to step 419 anddetermines a color of a corresponding pixel as a background color andthen, proceeds to step 417 below.

In contrast, when there is the primitive crossing with at least one ofthe rays of the four vertexes, the system proceeds to step 407 andgenerates a ray for the pivot of the pixel. After that, in step 409, thesystem performs a cross check between the generated ray of the pivot andthe primitive crossing with at least one of the rays of the fourvertexes of the pixel. Here, the system will be able to check if the rayof the pivot crosses with the cross primitive using a linear equationfor the ray of the pivot and a planar equation for the cross primitive.Undoubtedly, the system may perform a cross check for the ray of thepivot through an acceleration data structure. Also, when all rays offour vertexes of a predetermined pixel cross with one primitive, thesystem may omit a cross check for a ray of the pivot of thepredetermined pixel and determine that the ray of the pivot crosses withthe one primitive.

After that, in step 411, the system acquires color information ofprimitives crossing with at least one of the rays of the four vertexesand the ray of the pivot, for each of corresponding pixels. The systemitself may acquire color information of a primitive corresponding to aposition where each ray crosses with the primitive, or may acquire areference value of a storage unit 320 that stores the color informationof the primitive corresponding to the cross position.

Next, in step 413, the system determines weights for the acquired colorinformation according to the number of crosses of the cross-checkedprimitives by each pixel. And then, the system proceeds to step 415 anddetermines a color of a corresponding pixel according to the weight. Indetail, the system determines a weight for a color of a correspondingprimitive according to how many rays have crossed with each of thecross-checked primitives and then, determines a color of a correspondingpixel as in Equation 1 above. For example, assuming that ‘R1’, ‘R2’,‘R3’, ‘R4’, and ‘R5’ each denote rays of one of the four vertexes andthe pivot of a predetermined pixel, and that ‘R1’ crosses with aprimitive ‘P1’, ‘R2’ and ‘R3’ cross with no primitive, and ‘R4’ and ‘R5’cross with a primitive ‘P2’, the color determination unit 310 maymultiply C_(P1) (a color of primitive ‘P1’) by a weight ‘⅕’ since ‘P1’crosses with one ray, multiply C_(P2) (a color of primitive ‘P2’) by aweight ‘⅖’ since ‘P2’ crosses with two rays, and then add these productsand determine the addition result as a color value of the predeterminedpixel.

Next, the system proceeds to step 417 and colors each pixel of thescreen according to the color information of the each pixel and makes a3D image. And then, the system terminates the algorithm according to thepresent invention.

Exemplary embodiments of the present invention have an effect of, bygenerating and tracing rays for four vertexes and a ray for the pivot byeach pixel, minimizing the occurrence of an aliasing phenomenon whilesimultaneously minimizing an operation amount.

While the invention has been shown and described with reference tocertain preferred embodiments thereof, it will be understood by thoseskilled in the art that various changes in form and details may be madetherein without departing from the spirit and scope of the invention asdefined by the appended claims.

What is claimed is:
 1. A ray tracing method in a 3-Dimensional (3D)image system, the method comprising: generating four vertex rays forfour vertices and one pivot ray for a pivot of each basic unit pixel,wherein a total number of basic unit pixels determines a resolution ofthe 3D image system; sampling four vertices of each basic unit pixel tocheck if each of the four vertex rays of each basic unit pixel crosseswith a primitive; sampling the pivot of the each basic unit pixel tocheck if each of the pivot ray crosses with the primitive; anddetermining a color of each basic unit pixel using a result of thesampling for the four vertexes and the pivot of each basic unit pixel,wherein sampling the four vertices of each basic unit pixel comprises,when no primitive crossing with at least one of the four vertex raysexists, omitting a cross-check for the pivot ray and determining that noprimitive crossing with the pivot ray exists.
 2. The method of claim 1,wherein sampling for the four vertices comprises tracing each of thefour vertex rays through an acceleration data structure and checking ifeach of the four vertex rays crosses with the primitive existing in a 3Dvirtual space.
 3. The method of claim 2, further comprising, when atleast one of the four vertex rays crosses with the primitive, acquiringcolor information of the primitive corresponding to a cross position. 4.The method of claim 3, wherein the color information comprises at leastone of a color value of the primitive corresponding to the crossposition or a reference value of a memory configured to store the colorvalue.
 5. The method of claim 2, wherein sampling the pivot of eachbasic unit pixel comprises checking if the pivot ray crosses with theprimitive crossing with at least one of the four vertex rays of thebasic unit pixel.
 6. The method of claim 5, further comprising, when thepivot ray crosses with the primitive crossing with the at least one ofthe four vertex rays, acquiring color information of the primitivecorresponding to a cross position.
 7. The method of claim 6, wherein thecolor information comprises at least one of a color value of theprimitive corresponding to the cross position or a reference value of amemory configured to store the color value.
 8. The method of claim 1,wherein sampling the four vertices of each basic unit pixel comprises,when all of the four vertex rays of the basic unit pixel cross with theprimitive, omitting a cross check for the pivot and determining that thepivot ray crosses with the primitive crossing with all of the fourvertex rays.
 9. The method of claim 1, wherein determining the color ofthe each basic unit pixel comprises: according to a number of crosses ofprimitives cross-checked through the sampling, determining a weight forcolor information of each of the cross-checked primitives; anddetermining a color of each basic unit pixel using the weight.
 10. Anapparatus for tracing a ray in a 3-Dimensional (3D) image system, theapparatus comprising: a sampling circuitry configured to: generate fourvertex rays for four vertices and one pivot ray for a pivot of eachbasic unit pixel; sample four vertices of each basic unit pixel to checkif each of the four vertex rays of each basic unit pixel crosses with aprimitive; and sample the pivot of each basic unit pixel to check ifeach of the pivot ray crosses with the primitive, wherein a resolutionof the 3D image system is determined by a total number of basic unitpixels; and a color determination circuitry configured to: determine acolor of each basic unit pixel using the sampling result for the fourvertices and the pivot of each basic unit pixel, wherein, when noprimitive crossing with at least one of the four vertex rays of eachbasic unit pixel exists, the sampling circuitry is further configured toomit a cross-check for the pivot ray and determine that no primitivecrossing with the pivot ray exists.
 11. The apparatus of claim 10,wherein the sampling circuitry is configured to trace each of the fourvertex rays through an acceleration data structure and check if each ofthe four vertex rays crosses with the primitive existing in a 3D virtualspace.
 12. The apparatus of claim 11, wherein the sampling circuitry isfurther configured to acquire color information of the primitivecorresponding to a cross position when at least one of the four vertexrays crosses with the primitive.
 13. The apparatus of claim 12, whereinthe sampling circuitry is further configured to acquire the colorinformation comprising at least one of a color value of the primitivecorresponding to the cross position or a reference value of a memoryconfigured to store the color value.
 14. The apparatus of claim 11,wherein the sampling circuitry is configured to check if the pivot raycrosses with the primitive crossing with at least one of the four vertexrays of the basic unit pixel.
 15. The apparatus of claim 14, wherein thesampling circuitry is configured to acquire color information of theprimitive corresponding to a cross position when the pivot ray crosseswith the primitive.
 16. The apparatus of claim 15, wherein the samplingcircuitry is configured to acquire the color information comprising atleast one of a color value of the primitive corresponding to the crossposition or a reference value of a memory configured to store the colorvalue.
 17. The apparatus of claim 10, wherein, the sampling circuitry isconfigured to omit a cross check for the pivot and determine that thepivot ray crosses with the primitive crossing with all of the fourvertex rays of the basic unit pixel when all of the four vertex rays ofthe basic unit pixel cross with the primitive.
 18. The apparatus ofclaim 10, wherein the color determination circuitry is configured todetermine, according to a number of crossings with the primitivecross-checked through the sampling, a weight for color information ofeach of the cross-checked primitives, and determine a color of eachbasic unit pixel using the weight.